﻿using System.Collections.Generic;

namespace Iptv.ResourceTransfer.Model
{
    /// <summary>
    /// CP文件迁移配置
    /// </summary>
    public class LoadConfig
    {
        /// <summary>
        /// 编号、序号
        /// </summary>
        public int ID { get; set; }
        /// <summary>
        /// SP名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 标记
        /// </summary>
        public string Tag { get; set; }
        /// <summary>
        /// 任务失败重试次数
        /// </summary>
        public int RedoTimes { get; set; } = 0;  //默认不主动重试
        /// <summary>
        /// 远端回执服务地址
        /// </summary>
        public string RemoteEngineUrl { get; set; }
        /// <summary>
        /// 远端日志服务地址
        /// </summary>
        public string RemoteLogEngineUrl { get; set; }
        /// <summary>
        /// 源网盘挂载配置 "worksheet,WedoIPTV@2017,\\\\172.25.8.12\\worksheet,H:"
        /// </summary>
        public string SouceNetDiskConfig { get; set; }
        /// <summary>
        /// 目的网盘挂载配置 "worksheet,WedoIPTV@2017,\\\\172.25.8.12\\worksheet,H:"
        /// </summary>
        public string DestNetDiskConfig { get; set; }
        /// <summary>
        /// 后缀格式限制 为空或*时所有文件都可迁移，否则迁移指定后缀内容
        /// </summary>
        public string[] FileFormats { get; set; } = new string[] { "*" };
        /// <summary>
        /// 最大迁移线程数
        /// </summary>
        public int MaxThreadCount { get; set; } = 4;
        /// <summary>
        /// 是否自动删除过期文件
        /// </summary>
        public bool AllowDeleteExpireFile { get; set; } = true;
        /// <summary>
        /// 文件过期时长 单位：天 默认删除90天前文件
        /// </summary>
        public int FileExpireTime { get; set; } = 90;
    }

    /// <summary>
    /// 站点配置集合
    /// </summary>
    public class TransferConfig
    {
        /// <summary>
        /// 站点配置对象集合
        /// </summary>
        public List<LoadConfig> Transfer { get; set; }
    }
}
